import go from "gojs";



// const go = window.go
const $ = go.GraphObject.make

/**
 * 矩形文字框
 * @param {String} name - 模版的名字
 */
export function ReactText(name) {
  return $(
    go.Node,
    name,
    $(go.Shape, 'Reactangle', new go.Bindding('fill', 'color')),
    $(go.TextBlock, { margin: 5 }, new go.Binding('text', 'name'))
  )
}

/**
 * 图片、文字、提示文字的内容
 * @param {String} name -模版的名字
 */ 
export function ImageText(name) {
  return $(
    go.Node,
    name,
    $(go.TextBlock, { margin: 3 }, new go.Binding('vis') ),
    $(go.Picture, { maxSize: new go.Size(60, 60)}, new go.Binding('source', 'img')),
    $(go.TextBlock, { margin: 3}, new go.Bindding('text', 'name')),
  )
}
